package com.xxmw.transaction.model.app;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Getter;
import lombok.Setter;

import java.util.Objects;

/**
 * @author luowenliang
 * @since 2020/4/10 09:29
 */
@Getter
@Setter
@TableName("symbol")
public class Symbol {

    @TableId(type = IdType.AUTO)
    private Integer id;


    /**
     * 基础币种
     */
    private String baseCurrency;

    /**
     * 报价币种
     */
    private String quoteCurrency;

    /**
     * 交易对名称 btcusdt （btc基础币种 usdt兑换币种）
     */
    private String name;

    /**
     * 排序 升序
     */
    private Integer sort;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Symbol symbol = (Symbol) o;
        return Objects.equals(baseCurrency, symbol.baseCurrency) &&
                Objects.equals(quoteCurrency, symbol.quoteCurrency);
    }

    @Override
    public int hashCode() {
        return Objects.hash(baseCurrency, quoteCurrency);
    }
}
